<script setup lang="ts">
import type { EaWorkerWorkType } from './type'

const baseApi = '/ea/ea-worker-work-type'

const { loadData, loading, model } = useDetail<EaWorkerWorkType>(baseApi)

defineExpose({ init: loadData })
</script>

<template>
  <el-empty v-if="!Object.keys(model).length" v-loading="loading" />
  <el-descriptions v-else v-loading="loading" :column="2" border>
    <el-descriptions-item label="工人id" label-class-name="item-label" label-align="right">
      <span class="txt-short">
        {{ model.workerIdLabel }}
      </span>
    </el-descriptions-item>
    <el-descriptions-item label="工种id" label-class-name="item-label" label-align="right">
      <span class="txt-short">
        {{ model.workTypeIdLabel }}
      </span>
    </el-descriptions-item>
  </el-descriptions>
</template>

<style scoped lang="scss">
.el-descriptions {
  :deep(.el-descriptions__header) {
    margin: 0 10px 12px;
  }

  :deep(.item-label) {
    width: 120px;
  }
}
</style>
